<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit"/>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link href="<?php echo _APP_URL_;?>/favicon.ico" rel="icon">
	<title>应用管理</title>
	<link rel="stylesheet" href="<?php echo _APP_URL_;?>/library/layui/css/layui.css">
	<link rel="stylesheet" href="<?php echo _APP_URL_;?>/library/font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" href="<?php echo _APP_URL_;?>/system/platform/resource/admin.css">
	<link rel="stylesheet" href="<?php echo _APP_URL_;?>/library/deep/upload/upload.css">
	<script src="<?php echo _APP_URL_;?>/library/jquery/jquery-3.4.1.min.js"></script>
	<script src="<?php echo _APP_URL_;?>/library/jquery/jquery-ui.min.js"></script>
	<script src="<?php echo _APP_URL_ ;?>/library/echarts/echarts.min.js"></script>
	<script>
	_APP_URL_ = '<?php echo _APP_URL_;?>';
	_MODULE_NAME_ = '<?php echo _MODULE_NAME_;?>';
	</script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo layui-hide-xs"><?php echo $GLOBALS['config']['module']['name'] ?></div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <!-- <li class="layui-nav-item"><a href="">控制台</a></li> -->
      <li class="layui-nav-item"><a title="侧边伸缩" id="phpwork_side"><i class="layui-icon layui-icon-shrink-right" style="color:#fff;cursor:pointer"></i></a></li>
      <li class="layui-nav-item"><a title="刷新" onclick="location.reload()"><i class="layui-icon layui-icon-refresh" style="color:#fff;cursor:pointer"></i></a></li>
      <li class="layui-nav-item">
        <a href="javascript:;"><i class="layui-icon layui-icon-component"></i> <cite>应用</cite></a>
        <dl class="layui-nav-child" style="max-height:600px;overflow-y: auto;">
			<?php
			$sql_sys_module="select * from " . tablename('sys_module')  . "  order by id";
			$module_installed = $GLOBALS['db']->query($sql_sys_module)->fetchall();
			foreach($module_installed as $row){
			?>
				<dd><a href="<?php echo  url([ $row['identifie'] ,'admin/index','index','index.php']);?>" target="_blank"><?php echo $row['name']; ?> &nbsp; <span style="color:#666">(<?php echo $row['identifie'] ; ?>)</span></a></dd>
			<?php
			}
			?>
        </dl>
      </li>
    </ul>
    <ul class="layui-nav layui-layout-right">

      <li class="layui-nav-item layui-hide-xs" lay-unselect>
          <a href="<?php echo url(['platform','platform','index']);?>" target="_top" title="系统控制台"><i class="layui-icon layui-icon-console"></i> 控制台</a>
      </li>
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="<?php echo _APP_URL_;?>/system/platform/resource/head.png" class="layui-nav-img" loading="lazy">
          管理员
        </a>
        <dl class="layui-nav-child">
          <dd><a href="<?php echo url(['platform','admin','password_form']);?>">修改密码</a></dd>
          <dd><a href="<?php echo url('platform/index/logout');?>">安全退出</a></dd>
        </dl>
      </li>
      <!-- <li class="layui-nav-item"><a href="">退出</a></li> -->
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test" style="padding: 10px 0;">

        <li class="layui-nav-item">
            <a href="<?php echo url([_MODULE_NAME_,'admin/index','index']);?>"><i class="layui-icon layui-icon-home"></i>&emsp;<cite>应用首页</cite></a>
        </li>

        <!-- 
          <li class="layui-nav-item">
              <a href="<?php echo url(['cms','admin/config','index']);?>"><i class="layui-icon layui-icon-set"></i>&emsp;<cite>站点配置</cite></a>
          </li>
          <li class="layui-nav-item layui-nav-itemed">
              <a><i class="layui-icon layui-icon-list"></i>&emsp;<cite>文章管理</cite></a>
              <dl class="layui-nav-child">
                  <dd><a href="<?php echo url(['cms','admin/articlesort','index']);?>">文章分类管理</a></dd>
                  <dd><a href="<?php echo url(['cms','admin/article','index']);?>">文章管理</a></dd>
              </dl>
          </li>
        -->

        <?php
        $sql_sys_module_menu="select * from " . tablename('sys_module_menu')  . " where module_identifie='"._MODULE_NAME_."' order by id";
        $rs_sys_module_menu= $GLOBALS['db']->query($sql_sys_module_menu)->fetchAll();
        foreach($rs_sys_module_menu as $row){
        ?>
          <li class="layui-nav-item">
            <?php if($row['m_pid']=='0' && $row['controller']!=''){
              ?>
                <a href="<?php echo url([ $row['module_identifie'],'admin/'.$row['controller'] , $row['action'] , 'index.php' ]);?>"><i class="<?php echo $row['icon']?>" title="<?php echo $row['name']?>"></i>&emsp;<cite><?php echo $row['name']?></cite></a>
            <?php
            }elseif($row['m_pid']=='0' && $row['controller']==''){
            ?>
                <a><i class="<?php echo $row['icon']?>" title="<?php echo $row['name']?>"></i>&emsp;<cite><?php echo $row['name']?></cite></a>
                <dl class="layui-nav-child">
                    <?php
                    foreach($rs_sys_module_menu as $row2){
                        if($row['m_id'] == $row2['m_pid']){
                            ?>
                            <dd><a href="<?php echo url([ $row2['module_identifie'],'admin/'.$row2['controller'] , $row2['action'] , 'index.php' ]);?>"><?php echo $row2['name']?></a></dd>
                            <?php
                        }
                    }
                    ?>
                </dl>
            <?php } ?>
          </li>
        <?php
        }
        ?>

      </ul>
    </div>
  </div>
  
  <div class="layui-body" style="background-color: #fafafa;">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;">
